package com.example.day3mvp.mvp.presenter;

import android.util.Log;
import android.widget.Toast;

import com.example.day3mvp.mvp.contrat.LoginContrat;
import com.example.day3mvp.mvp.view.activity.LoginActivity;
import com.example.day3mvp.mvp.view.activity.MainActivity;
import com.example.mylibrary.CallBack.MyCallBack;
import com.example.mylibrary.mvp.presenter.BasePresenter;

import javax.inject.Inject;

public class LoginPresenter extends BasePresenter<LoginContrat.LoginModel,LoginContrat.LoginView> {
    @Inject
    public LoginPresenter(LoginContrat.LoginModel mModel, LoginContrat.LoginView mView) {
        super(mModel, mView);
    }
    //得到参数传入框架
    public void login(){
        mModel.requestLogin(mView.getUserName(), mView.getPwd(), new MyCallBack() {
            @Override
            public void Ok(String str) {
                mView.goMain();
                Log.i("TAG", "Ok:------> "+str);
            }

            @Override
            public void No(String message) {
                Log.i("TAG", "No:--------> "+message);

            }
        });
    }
}
